﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace PublishIP
{
    class LogService: ILogService
    {
        static object _logLock = new object();
        public void Log(string msg)
        {
            lock (_logLock)
            {
                var now = DateTime.Now;
                var logFileName = $"log-{now.Year}-{now.Month}-{now.Day}.txt";
                File.AppendAllLines(logFileName, new[] { $"{now}:{msg}" });
            }
        }
    }
}
